package com.zzy.controller;

import com.zzy.model.AjaxMsg;
import com.zzy.service.ClassicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class IndexController {

    @Autowired
    private ClassicService classicService;

    @RequestMapping({"/index"})
    public String list() {
        return "index.jsp";
    }

    @RequestMapping(value = "/grid")
    public void grid(HttpServletRequest request, HttpServletResponse response) {

    }

    /**
     * 返回一个json对象
     */
    @RequestMapping({"/test"})
    @ResponseBody
    public AjaxMsg tbCard(HttpServletRequest request, HttpServletResponse response) {
        return AjaxMsg.returnAjaxMsg(200,classicService.getAllClassic());
    }

}
